﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	mc:Ignorable="d"
	xmlns:local="clr-namespace:System8ToyMC"
	xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" xmlns:Behaviors="clr-namespace:Behaviors;assembly=Behaviors"
	x:Class="System8ToyMC.RandomVariableList"
	d:DesignWidth="640" d:DesignHeight="480">

	<UserControl.Resources>
		<DataTemplate x:Key="VariableListItemTemplate">
			<Grid>
				<local:RVNormalDistribution d:LayoutOverrides="Width, Height" Value="{Binding Mode=OneWay}"/>
			</Grid>
		</DataTemplate>
	</UserControl.Resources>

	<Grid x:Name="LayoutRoot">
		<Grid.RowDefinitions>
			<RowDefinition/>
			<RowDefinition Height="41"/>
		</Grid.RowDefinitions>
		<ListBox x:Name="VList" ItemsSource="{Binding Variables, Mode=OneWay}" ItemTemplate="{StaticResource VariableListItemTemplate}" ScrollViewer.HorizontalScrollBarVisibility="Disabled" HorizontalContentAlignment="Stretch" Margin="0" HorizontalAlignment="Left" MinWidth="150">
			<i:Interaction.Behaviors>
				<Behaviors:DragTargetBehavior DropObjectOK="DragTargetBehavior_DropObjectOK" DropObject="DragTargetBehavior_DropObject"/>
			</i:Interaction.Behaviors>
		</ListBox>
		<Button x:Name="ClearButton" Margin="8" Content="Clear" Grid.Row="1" Click="ClearVariableList"/>
	</Grid>
</UserControl>